{% extends "layout/base.html" %}
{% block content %}

<a href="#" onclick="wyloguj(1);" >Wyloguj</a>
{% endblock %}

{% block javascripts %}
{% parent %}
      <script type="text/javascript">
function wyloguj()
{
            jQuery.ajax({
                                        type: "POST",
                                        url: "{{'ajaxcontroler/wyloguj'|urlfile}}",
                                        success: function(wa){
                                            if(wa=='1')
                                                {
                                                alert('Miłego dnia..');
                                                window.location.href = "{{'login/index'|urlfile}}";
                                                }
                                                else
                                                    alert('Wystąpił błąd.');
                                        }
                                        });
}

      </script>
{% endblock %}
